package de.kalinasch.pa.placereminder.util;

import java.util.ArrayList;

import android.widget.EditText;

public class InputValidator {
	/**
	 * Checks, if every input field is filled by the user
	 * 
	 * @param _inputToValidate
	 *            A list of input data that has to be validated
	 * @return true if all fields were valid, otherwise false
	 */
	public static boolean checkEditTextInput(ArrayList<EditText> _inputToValidate) {
		boolean validInput = true;
		for (EditText input : _inputToValidate) {
			if (input.getText() == null || input.getText().length() <= 0) {
				input.setError("Bitte Daten eingeben");
				validInput = false;
			}
		}
		return validInput;
	}
}
